package com.tangk.tool.author.vo;

import com.tangk.tool.author.IAuthor;
import com.tangk.tool.author.dict.DictFactory;
import com.tangk.tool.util.Constans;

public class DefaultAuthor implements IAuthor{
	protected String bookName;
	String time;
	private final static String ENTER = "\r\n";
	@Override
	public String proccess() {
		StringBuilder rstStringBuilder = new StringBuilder();
		rstStringBuilder.append(getBookName());
		rstStringBuilder.append(getStart());
		rstStringBuilder.append(getIng());
		rstStringBuilder.append(getEnd());
		return rstStringBuilder.toString();
	}
	
	
	private String getEnd() {
		return "是魔鬼杀了他";
	}

	
	private String getIng() {
		return "";
	}


	private StringBuilder getStart() {
		return new StringBuilder(getTime()).append(getCase());
		//return new StringBuilder("2017年2月的第三个星期五"+ENTER+"花儿车"+ENTER+"小明"+"正正看着远处的山");
	}

	
	private StringBuilder getCase() {
		return DictFactory.getCaseDict().getRandom(new StringBuilder(Constans.defaultCase));
	}


	private StringBuilder getTime() {
		return DictFactory.getTimeDict().getRandom(new StringBuilder(""));
	}


	private StringBuilder getBookName() {
		return new StringBuilder(bookName==null?"未命名":bookName).append(ENTER);
	}
	
}
